#include "mainwindow.h"
#include <QApplication>
#include <QSplitter>
#include <QTextEdit>
#include <QTextCodec>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QFont font("ZYSong18030",12); //字体
    a.setFont(font);
    //主分隔窗口
    QSplitter *splitterMain =new QSplitter(Qt::Horizontal,0); //作为主分割窗口
    QTextEdit *textLeft = new QTextEdit(QObject::tr("Left Widget"),splitterMain);
    //插入主分割窗口
    textLeft -> setAlignment(Qt::AlignCenter);   //居中对齐
    //右部分割窗口
    QSplitter *splitterRight = new QSplitter(Qt::Vertical,splitterMain);//右分割窗口
    splitterRight -> setOpaqueResize(false);  //灰色粗线条
    QTextEdit *textUp = new QTextEdit(QObject::tr("Top Widget"),splitterRight);
    textUp -> setAlignment(Qt::AlignCenter);
    QTextEdit *textBottom = new QTextEdit(QObject::tr("Bottom Widget"),splitterRight);
    textBottom -> setAlignment(Qt::AlignCenter);
    //---------------------------------------------------
    QTextEdit *textLow = new QTextEdit(QObject::tr("Low Widget"),splitterRight);
    textLow -> setAlignment(Qt::AlignCenter);
    splitterMain ->setStretchFactor(1,1);
    splitterMain ->setWindowTitle(QObject::tr("Splitter"));
    splitterMain ->show();
    //MainWindow w;
    //w.show();

    return a.exec();
   //将主窗口分为Main和Right,再将、Right分为Up，Bottom,Low。
}
